package com.lframework.xingyun.basedata.vo.product.spec;

import com.lframework.starter.web.core.components.validation.IsNumberPrecision;
import java.math.BigDecimal;
import javax.validation.constraints.NotBlank;
import com.lframework.starter.web.core.vo.BaseVo;
import javax.validation.constraints.NotNull;

import com.lframework.xingyun.basedata.vo.product.speccost.ProductSpecCostDetailVo;
import io.swagger.annotations.ApiModelProperty;
import com.lframework.starter.web.core.components.validation.TypeMismatch;
import org.hibernate.validator.constraints.Length;
import java.io.Serializable;
import java.util.List;

import lombok.Data;

@Data
public class ProductSpecVo implements BaseVo, Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 属性id
     */
    @ApiModelProperty(value = "属性id", required = true)
    @NotBlank(message = "请输入属性id！")
    @Length(message = "属性id最多允许32个字符！")
    private String propertyId;

    /**
     * 属系值id
     */
    @ApiModelProperty(value = "属系值id", required = true)
    @NotBlank(message = "请输入属系值id！")
    @Length(message = "属系值id最多允许32个字符！")
    private String itemId;

    /**
     * 采购价
     */
    @ApiModelProperty(value = "采购价", required = true)
    @NotNull(message = "请输入采购价！")
    @TypeMismatch(message = "采购价格式有误！")
    @IsNumberPrecision(message = "采购价最多允许2位小数！", value = 2)
    private BigDecimal purchasePrice;

    /**
     * 零售价
     */
    @ApiModelProperty(value = "零售价", required = true)
    @NotNull(message = "请输入零售价！")
    @TypeMismatch(message = "零售价格式有误！")
    @IsNumberPrecision(message = "零售价最多允许2位小数！", value = 2)
    private BigDecimal retailPrice;

    /**
     * 销售价
     */
    @ApiModelProperty(value = "销售价", required = true)
    @NotNull(message = "请输入销售价！")
    @TypeMismatch(message = "销售价格式有误！")
    @IsNumberPrecision(message = "销售价最多允许2位小数！", value = 2)
    private BigDecimal salePrice;

    /**
     * 是否可用
     */
    @ApiModelProperty(value = "是否可用", required = true)
    @NotNull(message = "请输入是否可用！")
    private Boolean available;

    /**
     * 成本详情
     */
    @ApiModelProperty(value = "成本详情")
    private List<ProductSpecCostDetailVo> costDetailData;

}

